/*var variables = new Array('weekday','hour','monthday');
var variables_names = new Array('Dia de la semana','Hora','Dia del mes');

//var ports = new Array('port1','port2','port3');
//var ports_names = new Array("Lampara","Puerta","Ventana");
document.write('<script type="text/javascript" src="/cgi-bin/odaidata.cgi"></scr' + 'ipt>'); 
*/

function init_form(){
	var varlist = document.getElementsByName("variable");
	var vallist = document.getElementsByName("value");	
	linkDropdowns(varlist[0],vallist[0]);
	varlist[0].onchange();

/*	for (k=0;k<varr.length;k++){
		v = varr[k];
		// First group is for system variables
		var vgrp= document.createElement("optgroup");
		vgrp.label="Variables";
		v.appendChild(vgrp);

		for (i=0;i<variables.length; i++){                                      
			v.options[v.options.length] = new Option(variables_names[i],variables[i]);
		}
	
		// Second group is for odcontrol ports
		var pgrp= document.createElement("optgroup");
		pgrp.label="Ports";
		v.appendChild(pgrp);

		for (i=0;i<ports.length; i++){                                      
			v.options[v.options.length] = new Option(ports_names[i],ports[i]);
		}
	}

	// Populate actions dropdown, first with user's sequences
	var selgroup = document.getElementsByName("command");
	for (s=0;s<selgroup.length;s++){
		sel = selgroup[s];



		var sgrp = document.createElement("optgroup");
		sgrp.label="System";
		sel.appendChild(sgrp);

		sel.options[sel.options.length] = new Option("Nothing","false");

		var sgrp = document.createElement("optgroup");
		sgrp.label="Secuencias";
		sel.appendChild(sgrp);

		for (i=0;i<sequences.length;i++){
			sel.options[sel.options.length] = new Option(sequences_names[i],sequences[i]);
		}
		// And then with system scripts
		var sgrp = document.createElement("optgroup");
		sgrp.label="Scripts";
		sel.appendChild(sgrp);

		for (i=0;i<scripts.length;i++){
			sel.options[sel.options.length] = new Option(scripts_names[i],scripts[i]);
		}

		var sgrp = document.createElement("optgroup");
		sgrp.label="Secuencias";
		sel.appendChild(sgrp);

		for (i=0;i<sequences.length;i++){
			sel.options[sel.options.length] = new Option(sequences_names[i],sequences[i]);
		}
	}
	*/
}

